import os
from dotenv import load_dotenv

# 加载环境变量
load_dotenv()

class Config:
    """应用配置类"""
    
    # Prometheus配置
    PROMETHEUS_URL = os.getenv('PROMETHEUS_URL', 'http://localhost:9090')
    PROMETHEUS_API_VERSION = os.getenv('PROMETHEUS_API_VERSION', 'v1')
    
    # 应用配置
    DEBUG = os.getenv('DEBUG', 'False').lower() == 'true'
    SECRET_KEY = os.getenv('SECRET_KEY', 'dev-key-for-development-only')
    
    # LangChain配置
    LANGCHAIN_MODEL = os.getenv('LANGCHAIN_MODEL', 'gpt-3.5-turbo')
    LANGCHAIN_TEMPERATURE = float(os.getenv('LANGCHAIN_TEMPERATURE', '0.1'))
    
    # 历史记录配置
    MAX_HISTORY_ITEMS = int(os.getenv('MAX_HISTORY_ITEMS', '10'))
    
    # 图表配置
    DEFAULT_GRAPH_TYPE = os.getenv('DEFAULT_GRAPH_TYPE', 'line')
    GRAPH_WIDTH = int(os.getenv('GRAPH_WIDTH', '800'))
    GRAPH_HEIGHT = int(os.getenv('GRAPH_HEIGHT', '400'))

# 创建配置实例
config = Config()
